#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n;
	double a, sum = 0;
	printf("n:");
	scanf("%d", &n);
	if (n <= 0) {
		return 0;
	}
	for (int i = 1; i <= n; i++) {
		if (i % 3 == 0) {
			a = -1.0 / i;
		}
		else {
			a = 1.0 / i;
		}
		sum += a;
	}
	printf("sum=%5.2lf\n", sum);
	return 0;
}